export const STORAGE_KEY = 'forum'

let syncedData = {
    auth:{
        token:"",
        isLoggedIn:false
    },
    user: {
        Id: null,
        UserName: null,
        Email: null,
        Tel: null,
        Address: null,
        RealName: null,
        Image: null
    },
}

if (localStorage.getItem(STORAGE_KEY)) {
    syncedData = JSON.parse(localStorage.getItem(STORAGE_KEY))
}

export const state = Object.assign(syncedData)